// mobile bind
// ============

define(['zepto', 'sui', 'zData', 'jrange'], function($){
  return {
    init: function(data) {
      if(location.href.indexOf("#reloaded")==-1){
        location.href=location.href+"#reloaded";
        location.reload();
      }
      
      this.initRange();

    },
    initRange: function() {
      $('.single-slider').jRange({
          from: 1,
          to: 10,
          step: 1,
          format: function(value, pointer) {
            return (Math.round(value) + "%");
          },
          width: 200,
          theme: 'theme-blue',
          showLabels: true,
          snap: true
      });
      
      $(document).on("click", ".iconfont-minus", function() {
    	var recruitVal = Number($(".single-slider").val()) < 1 ? '1' : Number($(".single-slider").val()) - 1  
        $('.single-slider').jRange('setValue', recruitVal.toFixed(2));
      })
      
      $(document).on("click", ".iconfont-plus", function() {
    	
    	var recruitVal = Number($(".single-slider").val()) > 10 ? '10' : Number($(".single-slider").val()) + 1  
    	$('.single-slider').jRange('setValue', recruitVal.toFixed(2));
      })
      
      $(document).on("click", "", function() {
    	  
      })
    	  
    }
  }
})